<?php
function start_component(){
	include_once 'views/component_start.html.php';
}

function end_component(){
	global $database, $KToolBar;

	$database->setQuery("SELECT `id`, `title`, `firstname`, `surname` FROM #__".COMPONENT_PREFIX."customers WHERE `user_type` = 'manager'");
	$managers = $database->loadObjectList();
	
	foreach ($managers as $key=>$manager){
		$database->setQuery("SELECT `id`, `address`, `is_hotel`, `is_group` FROM #__".COMPONENT_PREFIX."units WHERE `owner_id` = '".$manager->id."'");
		$units[$key] = $database->loadObjectList();
	}

	include_once 'views/component_end.html.php';
}

function show_notice(){
	global $notice;
	
	include_once 'views/show_notice.html.php';
}
?>